function runOptimization() {
    const constraints = {
        load: $("#load-demand").val(),
        battery: $("#battery-capacity").val()
    };

    callAPI(API.optimize, constraints, showOptimizationResult);
}

function showOptimizationResult(data) {
    $("#wind-ratio").text(data.windRatio + "%");
    $("#solar-ratio").text(data.solarRatio + "%");
    renderPieChart(data.energyMix);
}